local skel = fk.CreateSkill {
  name = "lb__weilve",
}
local U = require "packages.utility.utility"

Fk:loadTranslationTable {
  ["lb__weilve"] = "味略",
  --[":lb__weilve"] = "当你使用非转化基本牌后，受到或造成非转化牌的伤害后，你可将这些牌置于判定区（每种花色数不超过你的体力上限）。",
  --10.25
  [":lb__weilve"] = "当你使用基本牌后，或因牌造成或受到伤害后，若此牌不为虚拟牌或转化牌，你可将之置于判定区。",

  ["#lb__weilve"] = "味略：你可以将%arg置于判定区",
  ["@lb__weilve-turn"] = "味略",

  ["$lb__weilve1"] = "来都来了，不如吃过再走。",
  ["$lb__weilve2"] = "有福自然同享。",
}

local weilve_spec = {
  anim_type = "masochism",
  can_trigger = function(self, event, target, player, data)
    if event == fk.CardUseFinished and data.card.type ~= Card.TypeBasic then return end
    return target == player and player:hasSkill(skel.name) and data.card and U.isPureCard(data.card)
        and table.contains({ Card.Processing, Card.DiscardPile }, player.room:getCardArea(data.card))
        --and (#table.filter(player:getCardIds("j"), function(id) return Fk:getCardById(id).suit == data.card.suit end) < player.maxHp)
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(player,
      { skill_name = skel.name, prompt = "#lb__weilve:::" .. data.card:toLogString() })
  end,
  on_use = function(self, event, target, player, data)
    player.room:moveCardTo(data.card, Player.Judge, player, fk.ReasonJustMove, skel.name)
  end,
}

skel:addEffect(fk.CardUseFinished, weilve_spec)
skel:addEffect(fk.Damage, weilve_spec)
skel:addEffect(fk.Damaged, weilve_spec)

return skel
